const express = require('express')
const app = express()

/**
 * 托管 /assets/files 目录下的静态资源
 *
 * http://127.0.0.1/将进酒·君不见.txt
 * http://127.0.0.1/茅屋为秋风所破歌.txt
 */
app.use(express.static('../../../../assets/files'))

/**
 * 可以托管多个目录，按照托管顺序依次查找
 *
 * http://127.0.0.1/Cheems.jpg
 */
app.use(express.static('../../../../assets/images'))

/**
 * 添加访问前缀
 *
 * http://127.0.0.1/images/Cheems.jpg
 */
app.use('/images', express.static('../../../../assets/images'))

app.listen(80, () => {
  console.log('Server running at http://127.0.0.1')
})
